package demo1221.pm;

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/*
HashSet底层维护的是HashMap,
HashSet集合的特点:无序不可重复.

LinkedHashMap extends HashMap;
LinkedHashMap集合维护了向集合中添加的顺序.
LinkedHashSet的底层维护的是LinkedHashMap
 */
public class Demo_04 {
    public static void main(String[] args) {
        Map<String, String> map = new LinkedHashMap<>();
        map.put("101", "jack");
        map.put("102", "tam");
        map.put("103", "tom");
        map.put("104", "rose");
        for (Map.Entry<String, String> entry : map.entrySet()) {
            System.out.println(entry);
        }

    }

    public static void demo01() {
        HashSet<String> set = new HashSet<>();
        set.add("hello");
        set.add("world");
    }
}
